package com.songcha.library_business.helper

import java.lang.StringBuilder

class DaoManagerHelper {
    companion object{
        @JvmStatic
        fun <T> getRangeStringByIds(ids: MutableList<T>):String{
            val sb= StringBuilder()
            sb.append("(")
            for(i in 0 until ids.size){
                val item=ids[i]
                sb.append("\""+item+"\"")
                if(i<ids.size-1) sb.append(",")
            }
            sb.append(")")
            return sb.toString()
        }

        @JvmStatic
        fun <T> getWhenCaseStringByIds(ids: MutableList<T>):String{
            val sb= StringBuilder()
            sb.append(" ")
            for(i in 0 until ids.size){
                val item=ids[i]
                sb.append(" when \""+item+"\" then "+i)
            }
            sb.append(" ")
            return sb.toString()
        }
    }
}